package com.samuel.basics.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * <p>
 * 文章
 * </p>
 *
 * @author samuel
 * @since 2021-01-20
 */
@TableName("b_article")
public class ArticleEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 作者主键
     */
    @TableField("author_id")
    private String authorId;

    /**
     * 标题
     */
    @TableField("title")
    private String title;

    /**
     * 文章类型 1：原创 2：转载 3：翻译
     */
    @TableField("type")
    private Integer type;

    /**
     * 发布形式 1：公开 2：私密 3：粉丝可见 4：VIP可见
     */
    @TableField("publish_type")
    private Integer publishType;

    /**
     * 内容
     */
    @TableField("context")
    private String context;

    /**
     * 访问数
     */
    @TableField("visible_num")
    private Integer visibleNum;

    /**
     * 收藏数
     */
    @TableField("collect_num")
    private Integer collectNum;

    /**
     * 审核人
     */
    @TableField("check_user_id")
    private String checkUserId;

    /**
     * 审核日期
     */
    @TableField("check_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime checkDate;

    /**
     * 审核消息
     */
    @TableField("check_message")
    private String checkMessage;

    public String getAuthorId() {
        return authorId;
    }

    public void setAuthorId(String authorId) {
        this.authorId = authorId;
    }
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }
    public Integer getPublishType() {
        return publishType;
    }

    public void setPublishType(Integer publishType) {
        this.publishType = publishType;
    }
    public String getContext() {
        return context;
    }

    public void setContext(String context) {
        this.context = context;
    }
    public Integer getVisibleNum() {
        return visibleNum;
    }

    public void setVisibleNum(Integer visibleNum) {
        this.visibleNum = visibleNum;
    }
    public Integer getCollectNum() {
        return collectNum;
    }

    public void setCollectNum(Integer collectNum) {
        this.collectNum = collectNum;
    }
    public String getCheckUserId() {
        return checkUserId;
    }

    public void setCheckUserId(String checkUserId) {
        this.checkUserId = checkUserId;
    }
    public LocalDateTime getCheckDate() {
        return checkDate;
    }

    public void setCheckDate(LocalDateTime checkDate) {
        this.checkDate = checkDate;
    }
    public String getCheckMessage() {
        return checkMessage;
    }

    public void setCheckMessage(String checkMessage) {
        this.checkMessage = checkMessage;
    }

    @Override
    public String toString() {
        return "ArticleEntity{" +
            "authorId=" + authorId +
            ", title=" + title +
            ", type=" + type +
            ", publishType=" + publishType +
            ", context=" + context +
            ", visibleNum=" + visibleNum +
            ", collectNum=" + collectNum +
            ", checkUserId=" + checkUserId +
            ", checkDate=" + checkDate +
            ", checkMessage=" + checkMessage +
        "}";
    }
}
